Page yet to be writen will be writen after
my board
examinations. Now that I have got my admit
card.
wish me best of luck
|
|
Why do I need to do programming?
Well most people believe that they don't need to know computer programming
to do computers. They are right too. Well there are all kinds of software
in the market. So why do I need to do programming. To tell you frankly
we don't need to do it. But if you are a person like me who wonders how
do programs work then you have to know programming. After the initial curve
of learning most people like me find writing a program is a mixture of
painting, and LEGO. Believe me once you know how to go about basic stuff
you will be able to write programs which will keep you busy throughout.
I first big project that is a text editor was a real challenge and I finished
it a few weeks back. Now I am working on my next project that is an interpreter
programing language, come to think of it the second one though sounds incredible,
I am doing it with much more ease than the text editor. The first project
is always difficult just as the first program you write yourself. After
that it's gets easier and easier. All programming requires is a dedicated
heart and that's it.
Back to 'Topics in this
page'
Introduction to C programming :
Programming is a very simple affair if you get a hang of it.
|
|
//this is our first C program
#include<stdio.h> main(int)
|
c:\work\>rhide
Hello World |
The printf statement is used to print data on the screen. Don't bother about the other lines now we will come to it later.
Now see the output carefully you will notice the 'c:\work\>rhide' above
the line 'Hello World', this line is there because we did not clear the
screen the next example we will over come this.
//this is our second C program
#include<stdio.h>
main(int)
|
Hello World
|
See the difference in the output. In the code '#include<conio.h>',
in C programming language there are very few internal commands (unlike
in basic where all the commands are internal). Here we have a rich collection
of standard header files which we write at the top of the program (in this
format #include<headerfile.h>), These files or header files contain
lot's of functions (commands) for example printf , clrscr,..... there are
many of these which we will learn in the coming topics.
Now we will write programs which will do basic output programs. In this sub topic we will learn more basic output programs. writing a single line on the screen will not get our work done. For example if we want to write a program which would display a menu on the screen.
For that we will learn the use of \n \t in printf function. \n stands for new line, \t for tab.
See the use of \n in the program
#include<stdio.h>
#include<conio.h> main(int)
|
Hello World
Bye world |
#include<stdio.h>
#include<conio.h> main(int)
|
Hello World
Bye world
|
In C there are the following data types: